<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

preg_match( '/img(.*?)src\=\"(.*?)\"/',$this->item->introtext, $match );			
$result = isset($match[2]) ? $match[2] : "";
$price = strip_tags($this->item->introtext);
?>
<?php
			//code lay hinh
				$arr2 = preg_split('/<(IMG|img) /', $this->item->introtext);
	
	
				//if(sizeof($arr2) <= 1) return '';
			    
			    
				$arr3 = preg_split('/src=\"/', $arr2[1]);
			    
			    
				//if(sizeof($arr3) <= 1) return '';
			    
				$arr4 = preg_split('/\"/', $arr3[1]);
			    
			    
			    
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				}
			
			?>
	<?php  if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
	<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
	<div class="image img-intro-<?php echo htmlspecialchars($imgfloat); ?>">
	<a class="fancy" href="<?php echo htmlspecialchars($images->image_fulltext); ?>">
	<img
		<?php if ($images->image_intro_caption):
			echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
		endif; ?>
		src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/></a>
	</div>
<?php endif; ?>		

	<p class="name-product"><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><?php echo $this->escape($this->item->title); ?></a></p>				


<?php echo $this->item->event->afterDisplayContent; ?>
